import os
from dotenv import load_dotenv

# 加载环境变量
load_dotenv()

# 项目和文件配置
#PROJECT_PATH = os.getenv("PROJECT_PATH", "/mnt/data-1/prediction_sdk")  # 项目根目录路径 (必需)
# TARGET_FILE = os.getenv("TARGET_FILE", "/mnt/data-1/prediction_sdk/prediction_sdk-dev_voyah_phigent/modules/prediction/evaluator/vehicle/cruise_rule_evaluator.cc")                    # 目标文件路径 (相对于PROJECT_PATH)

# PROJECT_PATH = os.getenv("PROJECT_PATH", "/home/pnc/Documents/llm_-dev (copy)")  # 项目根目录路径 (必需)
# TARGET_FILE = os.getenv("TARGET_FILE", "/home/pnc/Documents/llm_-dev (copy)/core/generator.py")                    # 目标文件路径 (相对于PROJECT_PATH)

PROJECT_PATH = os.getenv("PROJECT_PATH", "/home/pnc/Documents/apollo/modules")  # 项目根目录路径 (必需)
TARGET_FILE = os.getenv("TARGET_FILE", "/home/pnc/Documents/apollo/modules/planning/planning_open_space/coarse_trajectory_generator/hybrid_a_star.cc")                    # 目标文件路径 (相对于PROJECT_PATH)
OUTPUT_PATH = os.getenv("OUTPUT_PATH", "./output")            # 输出目录

# 项目扫描配置
EXCLUDED_DIRS = ['__pycache__', '.git', '.vscode', 'venv', 'env', 'node_modules', 'dist', 'build']
EXCLUDED_EXTENSIONS = ['.pyc', '.pyo', '.so', '.o', '.a', '.dll', '.exe', '.bin', '.obj', '.log']

# Ollama配置
OLLAMA_BASE_URL = os.getenv("OLLAMA_BASE_URL", "http://localhost:11434")
EMBEDDING_MODEL = os.getenv("EMBEDDING_MODEL", "bge-m3:latest")

#LLM_MODEL = os.getenv("LLM_MODEL", "qwq:32b-fp16") 
LLM_MODEL = os.getenv("LLM_MODEL", "qwq:latest") 

# 文档生成配置
MAX_ITERATIONS = int(os.getenv("MAX_ITERATIONS", "3"))
CHUNK_SIZE = int(os.getenv("CHUNK_SIZE", "1000"))
CHUNK_OVERLAP = int(os.getenv("CHUNK_OVERLAP", "200"))

# 输出和日志配置
ENABLE_STREAMING = os.getenv("ENABLE_STREAMING", "1") == "1"  # 默认启用流式输出
VERBOSE_LOGGING = os.getenv("VERBOSE_LOGGING", "1") == "1"    # 默认启用详细日志
LOG_DIR = os.getenv("LOG_DIR", "./logs")                      # 日志目录

# 提示词文件路径
PROMPT_DIR = os.path.join(os.path.dirname(__file__), "prompts")
ARCHITECT_PROMPT = os.path.join(PROMPT_DIR, "architect_prompt.txt")
PROGRAMMER_PROMPT = os.path.join(PROMPT_DIR, "programmer_prompt.txt")
OPTIMIZER_PROMPT = os.path.join(PROMPT_DIR, "optimizer_prompt.txt")

CLASS_PROMPT = os.path.join(PROMPT_DIR, "class_prompt.txt")  # 新增
FUNCTION_PROMPT = os.path.join(PROMPT_DIR, "function_prompt.txt")  # 新增

REVIEWER_PROMPT = os.path.join(PROMPT_DIR, "reviewer_prompt.txt")
COORDINATOR_PROMPT = os.path.join(PROMPT_DIR, "coordinator_prompt.txt")

# 流程图生成配置
ENABLE_FLOWCHARTS = os.getenv("ENABLE_FLOWCHARTS", "1") == "1"  # 默认启用流程图
FLOWCHART_PROMPT = os.path.join(PROMPT_DIR, "flowchart_prompt.txt")
